{% extends "base.html" %}
{% block title %}项目列表{% endblock %}
{% block user %}项目列表{% endblock %}

{% block scripts %}{{ super() }}
<script>
    $(document).ready(function () {
        $('#dt').DataTable(
            {

                "autoWidth": false,
                "search": {
                    "regex": true
                },

                "pageLength": 25,
                "order": [[0, "desc"]],

                dom: '<"top"flipB<"clear">>rt<"bottom"ipB<"clear">>',
                buttons: [
                    'copy', 'csv', 'excel'
                ]


            });
    });
</script>
{% endblock %}
{% block content %}
<div class="container">
    <div class="row">
        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
            {% include 'flash_message.html' %}
        </div>
        <h4 class="row page-header" style="text-align:center">
            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                项目列表
            </div>
        </h4>

        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
            <table id="dt" class="row-border hover compact" style="width:100%">
                <thead>
                    <tr>
                        <th>项目id</th>
                        <th>工作令号</th>
                        <th>项目名称</th>
                        <th>成员数量</th>
                        <th>总工时</th>
                        <th>上月工时</th>
                        <th>本月工时</th>
                        <th>昨日工时</th>
                        <th>今日工时</th>

                    </tr>
                </thead>
                <tbody>
                    {% for project in projects %}
                    <tr>
                        <td>{{ project[0] }}</td>
                        <td>
                            <a href="{{ url_for('bp_assess.list_project_org', project_id=project[0]) }}">
                                {{ project[1] }}
                            </a>
                        </td>
                        <td>
                            <a href="{{ url_for('bp_assess.project_detail', project_id=project[0]) }}">
                                {{ project[2] }}
                            </a>
                        </td>
                        <td>
                            {% if project[3] %}
                            {{ project[3] }}
                            {% else %}
                            0
                            {% endif %}
                        </td>

                        <td>
                            {% if project[4] %}
                            {{ project[4].__int__() }}
                            {% else %}
                            0
                            {% endif %}
                        </td>

                        <td>
                            {% if project[6] %}
                            {{ project[6].__int__() }}
                            {% else %}
                            0
                            {% endif %}
                        </td>

                        <td>
                            {% if project[5] %}
                            {{ project[5].__int__() }}
                            {% else %}
                            0
                            {% endif %}
                        </td>


                        <td>
                            {% if project[7] %}
                            {{ project[7].__int__() }}
                            {% else %}
                            0
                            {% endif %}
                        </td>

                        <td>
                            {% if project[8] %}
                            {{ project[8].__int__() }}
                            {% else %}
                            0
                            {% endif %}
                        </td>

                    </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
</div>
{% endblock %}